﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Rights/RightsMaster.Master" CodeBehind="RolesManPage.aspx.cs" Inherits="QuaManSys.Rights.RolesManPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>角色管理</title>
    <%--<link href="~/Css/index.css" rel="stylesheet" type="text/css" />
    <link href="~/Css/childindex.css" rel="stylesheet" type="text/css" />
    <link href="~/Css/GridView.css" rel="stylesheet" type="text/css" />--%>
    <link href="~/Css/RightsStyle.css" rel="Stylesheet" type="text/css" />
     <script type="text/javascript">
         function $id(s) {
             return document.getElementById(s);
         }
         //新增数据合法性检测
         function Btn_Search() {
             var ret = true;

             if ($id("txt_name").value == "") {
                 alert('请输入用户名');
                 ret = false;
             }

             return ret;
         }
        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphInner" runat="server">
    <div>
        <div>
            <asp:Panel ID="pnlButton" runat="Server">
                <asp:Label ID="lblRoleMan" runat="server" Text="角色管理"></asp:Label>
                <asp:Button ID="btn_search" CssClass="smallbtn" runat="server" Text="查找" OnClick="btn_search_Click" />
                <asp:Button ID="btn_Create" CssClass="smallbtn" runat="server" Text="创建" OnClick="btn_create_Click" />
            </asp:Panel>
            <asp:Panel ID="pnlSearch" runat="Server" Visible="false">
                搜索角色：<asp:TextBox ID="txt_name" CssClass="inputbox" runat="server"></asp:TextBox>
            </asp:Panel>
        </div>
        <div id="strinfo" runat="server" class="mbox pbox" visible="false">
        </div>
    <div class="gv">
        <asp:GridView ID="RoleList" runat="server" DataKeyNames="Id" CssClass="Grid" PageSize="15"
            AutoGenerateColumns="False" OnRowCommand="UserList_RowCommand">
            <FooterStyle CssClass="GridFooter" />
            <RowStyle CssClass="Row" />
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="编号" ReadOnly="True">
                    <ItemStyle HorizontalAlign="Left" Wrap="false" />
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="Name" HeaderText="名称" ReadOnly="True">
                    <ItemStyle HorizontalAlign="Left" Wrap="false" />
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="Description" HeaderText="描述" ReadOnly="True">
                    <ItemStyle HorizontalAlign="Left" Wrap="false" />
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="CreateTime" HeaderText="创建时间" ReadOnly="True">
                    <ItemStyle HorizontalAlign="Left" Wrap="false" />
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                </asp:BoundField>
                <asp:HyperLinkField HeaderText="权限分配" Text="授权" DataNavigateUrlFields="Id"
                        DataNavigateUrlFormatString="RoleAuth.aspx?Id={0}" />
                <asp:HyperLinkField HeaderText="详细信息" Text="详细信息" DataNavigateUrlFields="Id"
                        DataNavigateUrlFormatString="RoleDetail.aspx?Id={0}" />
                <asp:TemplateField HeaderText="删除" ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="btn_del" runat="server" CausesValidation="False" CommandName="Del"
                            Text="删除" CommandArgument='<%# Eval("Id")%>'></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="HeadingCell" />
            <AlternatingRowStyle BorderStyle="None" CssClass="AlternatingRow" />
        </asp:GridView>
            <asp:Panel ID="pnlCreateRole" runat="server" Visible="false">
                <table border="0" cellpadding="0" cellspacing="5">
                    <tr>
                        <td class="leftLab">
                            编号：
                        </td>
                        <td>
                            <asp:TextBox ID="txtRoleId" runat="server" class="inputbox" Style="width: 150px;"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="leftLab">
                            名称：
                        </td>
                        <td>
                            <asp:TextBox ID="txtRoleName" runat="server" class="inputbox" Style="width: 150px;"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="leftLab">
                            描述：
                        </td>
                        <td>
                            <asp:TextBox ID="txtRoleDescription" runat="server" TextMode="MultiLine" class="inputbox" Style="width: 150px;"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <asp:Button ID="btnSubmit" runat="server" Text="创建角色" 
                    onclick="btnSubmit_Click" />
            </asp:Panel>
        <%--<div id="GridViewMsg" style="padding: 5px;" runat="server">
        </div>--%>
    </div>
    </div>
</asp:Content>
